[Properties] Title=dartScript Lab Stage Updater Author=Deimos Design Subject=Demonstration Summary=An example of a script that's rather useful to anyone invested early in demScript's development, an automatic updater. Category=Demo SubCategory=Script CreatedBy=Lucifael ModifiedBy=Administrator CreatedOn=22/10/2022 06:23:03 ModifiedOn=13/01/2024 16:19:05 Tags=EXAMPLE, SCRIPT, UPDATER, INSTALLATION, INTERNET, CONNECTIVITY. EMail=deimosdesign75@gmail.com Website=http://www.deimos-design.co.uk EXEBind=C:\DemDrive\Lazarus\00 - Current\demScript\Examples\The Lab Stage Updater.exe [Properties_Notes] Count=16 1=

Introduction

2= 3=During The Lab stage of the development cycle for us at Deimos there will be updates on a regular basis, this will allow you to easily update by just running this script. 4= 5=A compiled version will be added to Tools, and it bails without waiting so it'll be updated too. 6= 7=Add to say dartTask on a week or monthly schedule to make sure you're always up to date. 8= 9=

Use

10= 11=With an active internet connection just run the script. We recommend you run this via file association or dartTask or the alike. It does after all update the editor and runtime during the course of operation, so not having the editor open would behoove you to do. 12= 13=

Notes

14= 15=This is a fairly good example of making your own automatic updater scripts. You could quite easily change this to be any application you wanted to automatically keep up to date. The "/silent" command line parameter is from Inno Setup, but most installer applications have something similiar. 16= [Script] Count=26 1=program dartScriptLabStageUpdater; 2={ Main } 3= 4=// Variable Declarations Here 5=var 6= url : String; 7= TFname : String; 8= 9=// This is the main body of the script 10=begin 11= // Set the URL to the installer on the Deimos website 12= url := 'http://www.deimos-design.co.uk/files/demScript_Inst.exe'; 13= // Use a temporary filename 14= TFname := BackSlash(strGetTempPath) + 'demScript_Inst.exe' 15= // If it exists still from the last run, remove it so we definately have a fresh copy. 16= if fileExists(TFname) then FileDelete(TFname); 17= NetHTTPGet(url, tfname); 18= if fileExists(TFname) then 19= begin 20= // We have the installer, now we just need to invoke it. 21= // But we're not waiting so the script execution finishes before the installer wants to replace any in use files from this script/Or Bound runtim. 22= ShellRun(Tfname, '/silent', wt_min); 23= end; 24=end. 25={ EOF } 26=